package hotel.service;

import java.util.List;

public interface IService<T> {

	public T findById(Class<T> clazz, int id);

	public boolean save(T obj);

	public boolean update(T obj);

	public boolean delete(T obj);
	
	public boolean deleteById(String upperCaseClazz,int id);

	public int getTotalCount(String entityName);
	
	/**
	 * 查询所有
	 * @param 实体类名
	 */
	public List<T> list(String hql);
	
	/**
	 * 查询所有
	 * @param 实体类名
	 */
	public List<T> listAll(String entityName);
	
	/**
	 * 分页查询
	 */
	public List<T> paging(String entityName,int firstResult,int maxResult);
	
	public T findFirstResult(String hql);

}
